import { ActionType } from './types';
import { ActionsUnion, ActionWithPayload, createAction } from '../types';
import { DesignInfo, LoadDesignsParams } from 'src/modules';

export const Actions = {
  loadDesigns: (params: LoadDesignsParams): ActionWithPayload<ActionType.LoadDesigns, LoadDesignsParams> =>
    createAction(ActionType.LoadDesigns, params),

  loadDesignsDone: (payload: DesignInfo[]): ActionWithPayload<ActionType.LoadDesignsDone, DesignInfo[]> =>
    createAction(ActionType.LoadDesignsDone, payload),
};

export type CanvasActions = ActionsUnion<typeof Actions>;
